﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace AITBarCodeRef
{
	[Serializable]
	public partial class AITBarCodeRefModel : UIModel
	{
		#region Constructor
		public AITBarCodeRefModel() : base("AITBarCodeRef")
		{
			InitClass();
			this.SetResourceInfo("b51cfd86-db69-4510-8672-6b990e3d5812");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private AITBarCodeRefModel(bool isInit) : base("AITBarCodeRef")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new AITBarCodeRefModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("f7522d3d-2b4a-44e5-9c26-86d88f5780fd");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.CUST.AITBarCodeUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.CUST.AITBarCodeBE.AITBarCode", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.CUST.AITBarCodeBE.AITBarCode", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldBarCode
		{
			get { return this.Fields["BarCode"]; }
		}
		public IUIField FieldItem_Code
		{
			get { return this.Fields["Item_Code"]; }
		}
		public IUIField FieldItem_Name
		{
			get { return this.Fields["Item_Name"]; }
		}
		public IUIField FieldItem_SPECS
		{
			get { return this.Fields["Item_SPECS"]; }
		}
		public IUIField FieldQty
		{
			get { return this.Fields["Qty"]; }
		}
		public IUIField FieldLotCode
		{
			get { return this.Fields["LotCode"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","992bfdf9-0625-4c14-8289-be013295cf0b");
			UIModelRuntimeFactory.AddNewUIField(this,"BarCode", typeof(String), true,"","System.String", "BarCode", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","67758545-04ed-49f4-a86d-9af8e699e0ec");
			UIModelRuntimeFactory.AddNewUIField(this,"Item_Code", typeof(String), false,"","System.String", "Item.Code", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","85eec9d3-99ba-4509-8335-6e67038524dc");
			UIModelRuntimeFactory.AddNewUIField(this,"Item_Name", typeof(String), false,"","System.String", "Item.Name", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","b8a1699f-0b3c-4f15-993c-3faa63ac92eb");
			UIModelRuntimeFactory.AddNewUIField(this,"Item_SPECS", typeof(String), true,"","System.String", "Item.SPECS", false,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","1277ed34-1666-44e8-9808-735875ceb89a");
			UIModelRuntimeFactory.AddNewUIField(this,"Qty", typeof(Decimal), true,"","System.Decimal", "Qty", true,true, false, "",false,(UIFieldType)1,"91031687-94bb-4988-a939-df7bf999ef4f","1e521a85-bdaf-427a-8537-e4dce6ba452a");
			UIModelRuntimeFactory.AddNewUIField(this,"LotCode", typeof(String), true,"","System.String", "LotCode", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","3f2fc1df-349a-458f-9ec6-1d155c988753");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  String BarCode
		{
			get{
				//object value = this[this.uiviewcRef.FieldBarCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldBarCode);
			}
			set{
				this[this.uiviewcRef.FieldBarCode] = value;
			}
		}
		
		
		public  String Item_Code
		{
			get{
				//object value = this[this.uiviewcRef.FieldItem_Code] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldItem_Code);
			}
			set{
				this[this.uiviewcRef.FieldItem_Code] = value;
			}
		}
		
		
		public  String Item_Name
		{
			get{
				//object value = this[this.uiviewcRef.FieldItem_Name] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldItem_Name);
			}
			set{
				this[this.uiviewcRef.FieldItem_Name] = value;
			}
		}
		
		
		public  String Item_SPECS
		{
			get{
				//object value = this[this.uiviewcRef.FieldItem_SPECS] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldItem_SPECS);
			}
			set{
				this[this.uiviewcRef.FieldItem_SPECS] = value;
			}
		}
		
		
		public  Decimal? Qty
		{
			get{
				//object value = this[this.uiviewcRef.FieldQty] ;
				//return (Decimal?)value;
				return GetValue<Decimal?>(this.uiviewcRef.FieldQty);
			}
			set{
				this[this.uiviewcRef.FieldQty] = value;
			}
		}
		
		
		public  String LotCode
		{
			get{
				//object value = this[this.uiviewcRef.FieldLotCode] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldLotCode);
			}
			set{
				this[this.uiviewcRef.FieldLotCode] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}